package com.dbdata.move.model;

// Generated cafuc by Hibernate Tools 4

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * AuthGroup generated by hbm2java
 */
@Entity
@Table(name = "auth_group")
public class AuthGroup implements java.io.Serializable {

	private Long id;
	private UserBaseInfo userBaseInfoByOperatorId;
	private UserBaseInfo userBaseInfoByCreaterId;
	private String groupName;
	private Date createTime;
	private Date operateTime;
	private byte identifier;
	private String remark;
	private Set<Authority> authorities = new HashSet<Authority>(0);
	private Set<SysUser> sysUsers = new HashSet<SysUser>(0);

	public AuthGroup() {
	}

	public AuthGroup(String groupName, Date createTime, byte identifier) {
		this.groupName = groupName;
		this.createTime = createTime;
		this.identifier = identifier;
	}

	public AuthGroup(UserBaseInfo userBaseInfoByOperatorId,
			UserBaseInfo userBaseInfoByCreaterId, String groupName,
			Date createTime, Date operateTime, byte identifier, String remark,
			Set<Authority> authorities, Set<SysUser> sysUsers) {
		this.userBaseInfoByOperatorId = userBaseInfoByOperatorId;
		this.userBaseInfoByCreaterId = userBaseInfoByCreaterId;
		this.groupName = groupName;
		this.createTime = createTime;
		this.operateTime = operateTime;
		this.identifier = identifier;
		this.remark = remark;
		this.authorities = authorities;
		this.sysUsers = sysUsers;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ID", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "OPERATOR_ID")
	public UserBaseInfo getUserBaseInfoByOperatorId() {
		return this.userBaseInfoByOperatorId;
	}

	public void setUserBaseInfoByOperatorId(
			UserBaseInfo userBaseInfoByOperatorId) {
		this.userBaseInfoByOperatorId = userBaseInfoByOperatorId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CREATER_ID")
	public UserBaseInfo getUserBaseInfoByCreaterId() {
		return this.userBaseInfoByCreaterId;
	}

	public void setUserBaseInfoByCreaterId(UserBaseInfo userBaseInfoByCreaterId) {
		this.userBaseInfoByCreaterId = userBaseInfoByCreaterId;
	}

	@Column(name = "GROUP_NAME", nullable = false, length = 50)
	public String getGroupName() {
		return this.groupName;
	}

	public void setGroupName(String groupName) {
		this.groupName = groupName;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "CREATE_TIME", nullable = false, length = 19)
	public Date getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "OPERATE_TIME", length = 19)
	public Date getOperateTime() {
		return this.operateTime;
	}

	public void setOperateTime(Date operateTime) {
		this.operateTime = operateTime;
	}

	@Column(name = "IDENTIFIER", nullable = false)
	public byte getIdentifier() {
		return this.identifier;
	}

	public void setIdentifier(byte identifier) {
		this.identifier = identifier;
	}

	@Column(name = "REMARK", length = 200)
	public String getRemark() {
		return this.remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@ManyToMany(fetch = FetchType.LAZY)
	@JoinTable(name = "auth_group_authority", joinColumns = { @JoinColumn(name = "GROUP_ID", nullable = false, updatable = false) }, inverseJoinColumns = { @JoinColumn(name = "AUTHORITY_CODE", nullable = false, updatable = false) })
	public Set<Authority> getAuthorities() {
		return this.authorities;
	}

	public void setAuthorities(Set<Authority> authorities) {
		this.authorities = authorities;
	}

	@ManyToMany(fetch = FetchType.LAZY)
	@JoinTable(name = "sys_user_auth_group", joinColumns = { @JoinColumn(name = "GROUP_ID", nullable = false, updatable = false) }, inverseJoinColumns = { @JoinColumn(name = "USER_ID", nullable = false, updatable = false) })
	public Set<SysUser> getSysUsers() {
		return this.sysUsers;
	}

	public void setSysUsers(Set<SysUser> sysUsers) {
		this.sysUsers = sysUsers;
	}

}
